function gradient = gmm2DProjGradient(params, mix1, mix2)

gradient = zeros(size(params));
for i = 1:mix1.ncentres
    for j = 1:mix2.ncentres
        gradient = gradient + mix1.priors(i)*mix2.priors(j)*gauss2DProjGradient(params, mix1.centres(i, :), mix1.covars(:, :, i), ...
                                                                                        mix2.centres(j, :), mix2.covars(:, :, j))';
    end
end

gradient = -gradient;
